package org.example.jiaxiao.service.impl;

import org.example.jiaxiao.entity.Course;
import org.example.jiaxiao.entity.Student;
import org.example.jiaxiao.mapper.ArrangeMapper;
import org.example.jiaxiao.service.ArrangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ArrangeServiceImpl implements ArrangeService {

    @Autowired
    private ArrangeMapper arrangeMapper;

    @Override
    public List<Student> getStudentinformation() {
        return arrangeMapper.getStudentinformation();
    }
    
    @Override
    public Map<String, Object> getStudentCourseInfo(Integer studentId) {
        return arrangeMapper.getStudentCourseInfo(studentId);
    }

    @Override
    public boolean arrangeCourse(Integer studentId, Integer courseId) {
        // 调用mapper进行课程安排操作，并返回是否成功
        int result = arrangeMapper.arrangeCourse(studentId, courseId);
        return result > 0;
    }

    @Override
    public boolean FillCourse(Map<String, Object> filterParams) {
        // 调用mapper进行课程填充或筛选操作，并返回是否成功
        int result = arrangeMapper.FillCourse(filterParams);
        return result > 0;
    }
    
    @Override
    public List<Course> getAllCourses() {
        return arrangeMapper.getAllCourses();
    }
}
